Skip to content

Add Doltgres DDL constraints to data-model-changes skill#2943

Open
nick-inkeep wants to merge 3 commits intomainfrom
fix/doltgres-ddl-constraints-skill-v2
Open

Add Doltgres DDL constraints to data-model-changes skill#2943
nick-inkeep wants to merge 3 commits intomainfrom
fix/doltgres-ddl-constraints-skill-v2

Conversation

@nick-inkeep
Copy link
Copy Markdown
Collaborator

@nick-inkeep nick-inkeep commented Apr 1, 2026

Summary

Add Doltgres DDL compatibility constraints to the data-model-changes skill — the 8 Drizzle schema patterns that produce migrations incompatible with Doltgres, the 2 drizzle-kit outputs that require manual editing, and a grep-based review checklist.

One file changed: .agents/skills/data-model-changes/SKILL.md (+79, -8)

What's in the skill update

Section A: Prevention table (8 constraints)

Constraint Doltgres root cause drizzle-kit trigger E2E tested?
pgEnum() alter_type.go:34ALTER TYPE is not yet supported AlterTypeAddValueConvertor Yes — schema → ALTER TYPE ADD VALUE → hard error
pgSchema() alter_table.go:96ALTER TABLE SET SCHEMA is not yet supported PgAlterTableSetSchemaConvertor Yes — move table between schemas → hard error
serial()/pgSequence() alter_sequence.go:105 — generic unsupported handler AlterPgSequenceConvertor Yes — modify increment → hard error
index().where() create_index.go:33WHERE is not yet supported CreatePgIndexConvertor (pass-through) Yes
index().concurrently() create_index.go:27concurrent index creation is not yet supported Same convertor (conditional) Yes
index().using('gin'/'gist'/'hash') create_index.go:30index method %s is not yet supported Same convertor (pass-through) Yes
index().on(sql\...`)` index_elem.go:32expression index attribute is not yet supported Same convertor (pass-through) Yes
col.desc() index_elem.go:57NULLS LAST for indexes is not yet supported Same convertor — .desc() silently emits DESC NULLS LAST Yes

Section B: Migration review gate (Step 7 + Step 3)

Hand-edit pattern drizzle-kit source Doltgres source E2E tested?
DROP TABLE ... CASCADE sqlgenerator.ts:1543 — unconditional CASCADE drop_table.go:46CASCADE is not yet supported Yes. Precedent: PR #2929 (generatedmanually removed)
ALTER COLUMN ... USING sqlgenerator.ts:1943 — branches 3-4 add USING alter_table.go:379ALTER TABLE with USING is not supported yet Yes. Workaround (add/backfill/drop/rename) also E2E verified — data intact.

Also added

  • Grep checklist (Tier 1 blockers + Tier 2 needs-review) — validated against all 17 manage migrations, zero false positives
  • 5 Doltgres-schema-only checklist items in the final verification checklist
  • Expanded frontmatter triggers for Doltgres-related routing

Verification method

Every constraint tested end-to-end: Drizzle TypeScript schema → npx drizzle-kit generate (v0.31.8) → inspect SQL → execute against real Doltgres 0.55.5 Docker container. Both workarounds (multi-step type change, pgEnum→varchar escape) also E2E tested with data integrity checks.

Test plan

  • All 8 prevention constraints E2E tested: real Drizzle schema → drizzle-kit 0.31.8 → real Doltgres 0.55.5
  • Both hand-edit patterns (CASCADE, USING) E2E tested through full chain
  • Both workarounds E2E tested (multi-step type change: 4 steps; pgEnum escape: 7 steps — data intact)
  • Grep checklist validated against all 17 manage migrations — zero false positives, zero false negatives
  • drizzle-kit source traced at tagged release (sqlgenerator.ts)
  • Doltgres source traced for all error messages (server/ast/)
  • PR #2929 git archaeology confirms CASCADE manual-edit precedent
  • CI passes
  • Skill auto-loads when editing manage-schema.ts

🤖 Generated with Claude Code

Document every known Doltgres DDL limitation that affects manage schema
migrations, with actionable workarounds and a migration review checklist.

Every claim was E2E verified: real Drizzle schemas → drizzle-kit 0.31.8
generate → SQL executed against real Doltgres 0.55.5 Docker container.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 1, 2026

⚠️ No Changeset found

Latest commit: 45362a5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agents-api Ready Ready Preview, Comment Apr 1, 2026 5:42am
agents-docs Ready Ready Preview, Comment Apr 1, 2026 5:42am
agents-manage-ui Ready Ready Preview, Comment Apr 1, 2026 5:42am

Request Review

@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog bot commented Apr 1, 2026

TL;DR — Adds Doltgres DDL compatibility constraints to the data-model-changes skill so that AI agents and engineers are warned away from Drizzle schema patterns that generate migrations incompatible with Doltgres. Every constraint is backed by live testing against Doltgres 0.55.5.

Key changes

  • Add Doltgres DDL constraints section — 8-row prevention table mapping unsupported Drizzle APIs (pgEnum, pgSchema, serial, partial indexes, etc.) to exact Doltgres error messages and recommended alternatives
  • Add migration review gate in Step 7 — two hand-edit patterns (DROP TABLE CASCADE, USING clause), a two-tier grep checklist validated against all 17 manage migrations, and a DROP INDEX bug note
  • Expand skill frontmatter triggers — routes the skill on Doltgres-specific terms (Doltgres, CASCADE, ALTER TYPE, manage-schema.ts, migration failure, etc.) in addition to the existing generic triggers
  • Add cross-reference in "Adding a Column" Step 3 — points to the Step 7 review checklist for manage-database migrations
  • Add 5 Doltgres verification items to final checklist — ensures no pgEnum, pgSchema, serial, incompatible index patterns, or unreviewed generated SQL slips through

Summary | 1 file | 3 commits | base: mainfix/doltgres-ddl-constraints-skill-v2


Doltgres DDL prevention table

Before: The skill had no guidance on Doltgres limitations — agents could freely use pgEnum(), pgSchema(), expression indexes, and other patterns that produce migrations that hard-fail on Doltgres.
After: An 8-row table maps each forbidden Drizzle API to the exact Doltgres error message and a tested alternative. Scoped explicitly to manage-schema.ts so runtime schema work is unaffected.

Includes a varchar + Zod code example (the pattern already used throughout the manage schema) and a 7-step escape hatch for inheriting existing pgEnum columns. Version-pinned to Doltgres 0.55.5 + drizzle-kit 0.31.8 with a re-verify note.

SKILL.md


Migration review gate with grep checklist

Before: Step 7 said "review generated SQL" with no specific guidance on what to look for.
After: Step 7 includes a fix-it table for the two most common drizzle-kit incompatibilities, a two-tier grep checklist, and notes on DROP INDEX breakage and drizzle-kit v1 beta status.

What are the two tiers?

Tier 1 (blockers — must fix): DROP.*CASCADE, ALTER TYPE, CONCURRENTLY, non-btree index methods, SET SCHEMA, ADD VALUE, NULLS. Tier 2 (needs review): SET DATA TYPE (safe for widening, dangerous with USING), ON CONFLICT, CREATE INDEX ... WHERE. The patterns were validated against all 17 existing manage migrations with zero false positives.

SKILL.md

Pullfrog  | View workflow run | Triggered by Pullfrog | Using Claude Opus𝕏

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thorough, well-evidenced documentation addition. Two actionable issues: broken markdown rendering from nested backticks in the constraint table, and a version-pinning claim that's only partially true. The rest reads cleanly and the grep checklists validate against existing migrations with zero false positives.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Claude Opus𝕏

Copy link
Copy Markdown
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review Summary

(3) Total Issues | Risk: Low

🟠⚠️ Major (1) 🟠⚠️

Inline Comments:

  • 🟠 Major: SKILL.md:29 Misleading version pinning claim — docker-compose.dbs.yml (local dev) uses :latest, not the pinned 0.55.5

🟡 Minor (2) 🟡

Inline Comments:

  • 🟡 Minor: SKILL.md:46 Example claims pattern exists in manage-schema but uses runtime-schema column
  • 🟡 Minor: SKILL.md:391 PR #2929 reference lacks hyperlink

💭 Consider (1) 💭

Inline Comments:

  • 💭 Consider: SKILL.md:410 Forward-looking drizzle-kit v1 beta reference may become stale

🧹 While You're Here (1) 🧹

🧹 1) SKILL.md No cross-reference to manage-database-usage skill

Issue: The data-model-changes skill documents Doltgres DDL constraints but does not reference the existing manage-database-usage skill which covers branch-scoped connections and withRef patterns.

Why: Users who land on this skill for schema changes may not discover the companion skill that explains the critical branch-scoping patterns essential when working with the manage database.

Fix: Add a brief "See also" note after the Doltgres DDL Constraints section: **See also:** The manage-database-usage skill covers branch-scoped connections (withRef, c.get('db')) required when reading/writing to the manage database.

Refs: manage-database-usage skill


💡 APPROVE WITH SUGGESTIONS

Summary: This is a well-researched and thoroughly documented skill update. The PR description demonstrates exceptional rigor — every claim was verified through multiple layers of evidence including live Doltgres testing, drizzle-kit source tracing, and end-to-end migration validation. The suggestions above are minor accuracy and usability improvements. The version pinning note deserves attention since developers using pnpm setup-dev will get :latest rather than the documented 0.55.5, but this doesn't invalidate the documented constraints — it just needs clearer context.

Discarded (3)
Location Issue Reason Discarded
SKILL.md:3 Frontmatter description is unusually long (538 chars, 25+ triggers) Valid design choice for comprehensive discovery; the breadth is intentional per PR description which explains the routing rationale
SKILL.md:29 drizzle-kit version says 0.31.8 but package.json specifies ^0.31.6 The skill correctly notes "resolved from ^0.31.6" — this is accurate documentation of resolved vs. constraint versions
N/A Docs review findings File is an internal AI skill file (.agents/skills/), explicitly out of scope for docs review per guidelines
Reviewers (3)
Reviewer Returned Main Findings Consider While You're Here Inline Comments Pending Recs Discarded
pr-review-devops 5 0 0 1 3 0 1
pr-review-consistency 4 0 1 0 1 0 2
pr-review-docs 1 0 0 0 0 0 1
Total 10 0 1 1 4 0 4

Note: Both devops and consistency reviewers flagged the same Doltgres version inconsistency — findings were deduplicated.

@github-actions github-actions bot deleted a comment from claude bot Apr 1, 2026
- Fix nested backtick rendering in constraint table (lines 38, 41)
- Clarify version pinning: note docker-compose.dbs.yml uses :latest
- Replace fictional status column example with real credentialScope from manage-schema.ts
- Add hyperlink to PR #2929 precedent
- Remove specific beta version number to reduce staleness

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nick-inkeep
Copy link
Copy Markdown
Collaborator Author

Review feedback addressed (498c961)

All 7 review threads resolved. Summary:

Thread Finding Action
pullfrog: line 38, 41 Nested backticks break markdown rendering Fixed — wrapped with double-backtick delimiters
pullfrog + claude: line 29 Version pinning claim misleading (dbs.yml uses :latest) Fixed — added explicit note about docker-compose.dbs.yml and docker-compose.isolated.yml using :latest
claude: line 46 Example status column doesn't exist in manage-schema.ts Fixed — replaced with credentialScope (line 429 of manage-schema.ts)
claude: line 391 PR #2929 reference lacks hyperlink Fixed — added link
claude: line 410 Forward-looking beta version number will go stale Fixed — removed specific version, kept PR reference only
claude: "while you're here" Cross-reference manage-database-usage skill Declined — skills should be standalone per write-skill principles. Both skills are independently discoverable via their triggers.

Copy link
Copy Markdown
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review Summary

(0) Total Issues | Risk: Low

This is a delta review scoped to the changes since the prior automated review (commit bf98fe4d6498c961ed).

✅ Prior Feedback Addressed

All 4 issues from the prior reviews have been properly resolved:

Prior Finding Status Verification
🟠 Version pinning claim misleading ✅ Fixed Line 29 now notes that docker-compose.dbs.yml and docker-compose.isolated.yml use :latest
🟡 Example used wrong column (status) ✅ Fixed Line 50 now uses credentialScope — verified against manage-schema.ts:429
🟡 PR #2929 lacked hyperlink ✅ Fixed Line 391 now has proper markdown link
🟡 Nested backticks broke markdown ✅ Fixed Lines 38, 41 use double-backtick escaping

🕐 Pending Recommendations (1)

  • 🧹 SKILL.md No cross-reference to manage-database-usage skill (optional enhancement from prior review — pre-existing gap, not blocking)

✅ APPROVE

Summary: The delta cleanly addresses all prior feedback. The credentialScope example was verified against the actual schema, the version note accurately reflects the compose file configurations, and the PR #2929 reference links to a real merged PR. This is a well-researched skill update with thorough evidence backing every claim. Ship it! 🚀

Reviewers (0)
Reviewer Returned Main Findings Consider While You're Here Inline Comments Pending Recs Discarded
Total 0 0 0 0 0 1 0

Note: Delta-only review — no sub-reviewers dispatched since all changes are documentation fixes addressing prior feedback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review Summary

(0) Total Issues | Risk: Low

This is a delta review scoped to the changes since the prior automated review (commit 498c961ed45362a5ec).

✅ Delta Analysis

Commit: 45362a5ec — "Tighten intro paragraph — remove redundant sentence"

The single change condenses two sentences into one:

  • Before: "Doltgres does not support the full PostgreSQL DDL surface. drizzle-kit generates standard PostgreSQL SQL, which means certain Drizzle schema patterns produce migrations that fail on Doltgres."
  • After: "drizzle-kit generates standard PostgreSQL SQL that may be incompatible with Doltgres."

This is a clean editorial improvement — the redundant first sentence ("Doltgres does not support the full PostgreSQL DDL surface") is subsumed by the second, and "may be incompatible" is appropriately softer than "fail" since the constraints depend on which DDL patterns are used.

🕐 Pending Recommendations (1)

  • 🧹 SKILL.md No cross-reference to manage-database-usage skill — author declined per write-skill principles (skills should be standalone; both are independently discoverable via triggers)

✅ APPROVE

Summary: The delta is a purely editorial improvement that makes the intro more concise without changing meaning. All substantive feedback from prior reviews was addressed. This well-researched skill update with thorough evidence backing every Doltgres constraint is ready to ship. 🚀

Reviewers (0)
Reviewer Returned Main Findings Consider While You're Here Inline Comments Pending Recs Discarded
Total 0 0 0 0 0 1 0

Note: Delta-only review — no sub-reviewers dispatched. The change is a trivial editorial refinement that does not warrant re-review of the entire file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant